package
{
    import mx.collections.ArrayCollection;
    
    public class TreeNode {
    
         public var id : int;
         public var name : String;
//         public var type : int;
         public var children : ArrayCollection;
    
         public function addChild(node : TreeNode) : void {
    
          if (this.children == null)
              this.children = new ArrayCollection();
              children.addItem(node);
    
         }
         public function toString():String
         {
             return name;
          
         }
    //Similarly you could have getNode();
    
    }
}